package com.lframework.xingyun.basedata.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lframework.xingyun.basedata.entity.ArmyProductInfo;
import com.lframework.xingyun.basedata.mappers.ArmyProductInfoMapper;
import com.lframework.xingyun.basedata.service.IArmyProductInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author bogewang
 * @since 2024-09-29
 */
@Service
public class ArmyProductInfoServiceImpl extends ServiceImpl<ArmyProductInfoMapper, ArmyProductInfo> implements IArmyProductInfoService {
    @Autowired
    private ArmyProductInfoMapper armyProductInfoMapper;

    @Override
    public List<ArmyProductInfo> selectAll() {
        LambdaQueryWrapper<ArmyProductInfo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ArmyProductInfo::getDs, selectMaxDs());
        return armyProductInfoMapper.selectList(wrapper);
    }

    @Override
    public String selectMaxDs() {
        return armyProductInfoMapper.selectMaxDs();
    }
}
